package entity

import "time"

type Group struct {
	ID		int				`json:"id"`
	Name	string			`json:"name" binding:"required"`
	CreatedAt	time.Time	`json:"created_at"`
	Users	[]*User			`json:"users"`
}

type Groups []*Group

func (g Groups) ToIDs() []int {
	ids := make([]int, 0)
	if g == nil {
		return ids
	}
	
	for _, gr := range g {
		ids = append(ids, gr.ID)
	}
	return ids
}